package com.mercury.service.impl;

import com.mercury.model.User;
import com.mercury.service.UserService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Service
public class UserServiceImpl implements UserService{
    @Override
    public List<User> findUsers(long max, int size) {
        return createUserList(size);
    }

    private List<User> createUserList(int size){
        List<User> lists = new ArrayList<User>();
        for (int i = 0; i<size; i++){
            User user = new User("mercury"+i,new Date());
            lists.add(user);
        }
        return lists;
    }

    @Override
    public User saveUser(User user) {
        return user;
    }

    @Override
    public void add(int i) {

    }

    @Override
    public User findUser(String userName) {
        return new User(21L,"mercury","11");
    }
}
